package com.wunu.zn.api.lock.model;
import common.plugin.mybatis.Db;
import common.plugin.mybatis.Model;

import common.plugin.mybatis.Table;

@Table("sys_user")
public class SysUserEntity  extends Model<SysUserEntity>{

	/**
	 * 模糊查找用户
	 * @return
	 */
	public static SysUserEntity findAdminByPhone(String phone) {
		String sql = "select u.USERNAME FROM sys_user u WHERE u.PHONE =#{phone} limit 1 ";
		return Db.findFirst(SysUserEntity.class,sql, "phone", phone);
	}
	
	/**************************
	 *****   数据库操作   ******
	 **************************/
	
	public void save() 
	{
		Db.save(getMe());
	}
	
	public void update() 
	{
		Db.update(getMe());
	}
}
